Home | Computer Science

Learning C Language



What is C ?

C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.




Features of C




What is compilation?

The compilation is the process of converting the source code of the C language into machine code. As C is a mid-level language, it needs a compiler to convert it into an executable code so that the program can be run on our machine. The compilation is a process of converting the source code into object code. It is done with the help of the compiler. The compiler checks the source code for the syntactical or structural errors, and if the source code is error-free, then it generates the object code.

Know more about compilation in C language




Steps of Learning C


Keywords

Keywords are the words that have special meaning in programming that are predefined and are stored in c library. Keywords in C are displayed white in color.
Some examples of keywords are int, char, float, if, else, switch, case, break, goto, jump etc.


Click here to view list of keywords


Variables

Variables are temporary memory storing place defined by the users.
Variables taken can be alphabets, number or symbols or group of them but it must start with an alphabet. For eg: The variable can be a1 but not 1a.


Constants

Constants are the values or variables that cannot be changed throughout the program. It means that once we assign value to the constant, then we can’t change it throughout the execution of a program- it stays fixed.


Instuctions

Instructions are thr statements written in C. Instuction commands the compiler to take certain actions.




Basic Program in C

Program of printing a message of 'Hello World'

#include<stdio.h>
main()
{
printf("Hello World");
}


Here #include<stdio.h> is the header file which already contains certain block of code. std in stdio stands for standard, i for inpu and o for output, h stands for header. main() is pre-defined function from where the actual program starts. printf is the function in C used to print or display the text , message, result etc on the output screen.




clrscr() : It is used to clear the output screen.

\n : It is used to get into the next line.

\t : It is used to give the tab space between two words, characters, numbers, etc..

; : It signifies the end of the statement.

getch() : It is used to compile the program.

Know more about c programming



Data Types

Syllabus

Operators

Control Statements

Functions

Array

Structure

Pointer

String Function

File Handling







Thank You!!!